CREATE TABLE node_tags 
(
ref INTEGER NOT NULL,
key TEXT,
value TEXT
);

CREATE TABLE nodes 
(
id INTEGER NOT NULL PRIMARY KEY,
lon REAL NOT NULL,
lat REAL NOT NULL
);

CREATE TABLE way_nodes 
(
way INTEGER NOT NULL,
num INTEGER NOT NULL,
node INTEGER NOT NULL
);

CREATE TABLE way_tags 
(
ref INTEGER NOT NULL,
key TEXT,
value TEXT
);

CREATE TABLE ways 
(
id INTEGER NOT NULL PRIMARY KEY
);

CREATE TABLE ways_full 
(
id INTEGER PRIMARY KEY  NOT NULL ,
id_way INTEGER NOT NULL ,
id_node INTEGER NOT NULL, 
name TEXT,
node_lat REAL,node_lon REAL, 
type TEXT NOT NULL  DEFAULT unclassified
);